from django.conf.urls.defaults import *
from django.views.generic import list_detail

from browsertests.useragents.models import Useragent

PAGINATE_BY = 100

useragent_list = {
    'queryset': Useragent.objects.select_related(),
    'template_object_name': 'useragent',
    'paginate_by': PAGINATE_BY,
}

useragent_detail = {
    'queryset': Useragent.objects.select_related(),
    'template_object_name': 'useragent',
}

urlpatterns = patterns('',
    url(
        regex   = '^page(?P<page>[-\w]+)/$',
        view    = list_detail.object_list,
        kwargs  = useragent_list,
        name    = 'useragent-list',
    ),
    url(
        regex   = '^(?P<object_id>.+)/$',
        view    = list_detail.object_detail,
        kwargs  = useragent_detail,
        name    = 'useragent-detail',
    ),
)
